package cn.tedu.csmall.sso.utils;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

@Getter
@ToString(callSuper = true)
//使用继承时，调用toString方法，
// 默认不会输出父类中的字段，
// 所以使用callSuper = true，调用父类字段
@EqualsAndHashCode(callSuper = true)
public class AdminUserDetails extends User {
    //用户id
    private Long id;
    public AdminUserDetails(Long id,
                            String username,
                            String password,
                            boolean enabled,
                            boolean accountNonExpired,
                            boolean credentialsNonExpired,
                            boolean accountNonLocked,
                            Collection<? extends GrantedAuthority> authorities) {
        super(username, password, enabled,
                true,
                true,
                true, authorities);
        this.id=id;
    }
}
